import request from '@/utils/request'
import qs from 'qs'

/** *******************        purch-activity          ********************/

export function fetchActivityList(query) {
  return request({
    url: '/purch/activity/list',
    method: 'get',
    params: query
  })
}

export function fetchActivity(id) {
  return request({
    url: `/purch/activity/info/${id}`,
    method: 'get'
  })
}

export function createActivity(data) {
  return request({
    url: '/purch/activity/info',
    method: 'post',
    data
  })
}

export function updateActivity(id, data) {
  return request({
    url: `/purch/activity/info/${id}`,
    method: 'put',
    data
  })
}

export function deleteActivity(id) {
  return request({
    url: `/purch/activity/info/${id}`,
    method: 'delete'
  })
}

/** *******************        purch-detail         ********************/

export function listDetial() {
  return request({
    url: `/purch/activity/detail/list`,
    method: 'get'
  })
}